﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp
{
    public class Constants
    {
        public const double pi = 3.1416;
        public readonly DateTime BirthDate;
        public Constants(DateTime birthDate)
        {
            BirthDate = birthDate;
        }

        public static void Show()
        {
            Constants con = new Constants(new DateTime(1974,8,18));
            // 只读属性这里不能修改
            // con.BirthDate=DateTime.Now;
            Console.WriteLine(Constants.pi+"\n");
            Console.WriteLine(con.BirthDate.ToString("d"));
        }
    }
}
